from machine import Pin, ADC


class Handgrip:
    def __init__(self, pin) -> None:
        self.handgrip = ADC(Pin(pin))
        self.handgrip.atten(ADC.ATTN_11DB)
        self.handgrip.width(ADC.WIDTH_12BIT)  # 设置12位数据宽度

# ============================================================================== #

    """
    获取握把值
    """

    def ADC_Acquisition(self):
        return self.handgrip.read()
